package com.whfc.mach.service;

import com.whfc.common.exception.BizException;
import com.whfc.common.result.ListData;
import com.whfc.common.result.PageData;
import com.whfc.mach.dto.AppMachDataStatDTO;
import com.whfc.mach.dto.MachDayDataDTO;
import com.whfc.mach.dto.MachMonthReportDTO;
import com.whfc.mach.dto.report.AppMachReportDTO;
import com.whfc.mach.dto.report.AppMachWeekReportDTO;

import java.util.Date;
import java.util.List;

/**
 * @author sun_guodong
 * @description 设备报表服务
 * @date 2021-03-10
 */
public interface AppReportService {
    /**
     * 设备日报
     *
     * @param deptIds
     * @param date
     * @param pageNum
     * @param pageSize
     * @return
     * @throws BizException
     */
    PageData<MachDayDataDTO> dayReport(List<Integer> deptIds, Date date, Integer pageNum, Integer pageSize) throws BizException;

    /**
     * 小程序报表-设备数据列表
     *
     * @param deptIds
     * @param startDate
     * @param endDate
     * @return
     * @throws BizException
     */
    ListData<MachDayDataDTO> dayReport(List<Integer> deptIds, Date startDate, Date endDate) throws BizException;

    /**
     * 设备月报
     *
     * @param deptIds
     * @param pageNum
     * @param pageSize
     * @param startDate
     * @param endDate
     * @return
     * @throws BizException
     */
    PageData<MachMonthReportDTO> monthReport(List<Integer> deptIds, Integer pageNum, Integer pageSize, Date startDate, Date endDate) throws BizException;

    /**
     * 设备年报
     *
     * @param deptIds
     * @param pageNum
     * @param pageSize
     * @param year
     * @return
     * @throws BizException
     */
    PageData<MachMonthReportDTO> yearReport(List<Integer> deptIds, Integer pageNum, Integer pageSize, int year) throws BizException;

    /**
     * 设备报表数据统计
     *
     * @param deptIds
     * @param startDate
     * @param endDate
     * @return
     * @throws BizException
     */
    AppMachDataStatDTO reportStat(List<Integer> deptIds, Date startDate, Date endDate) throws BizException;

    /**
     * 设备年报数据统计
     *
     * @param deptIds
     * @param year
     * @return
     * @throws BizException
     */
    AppMachDataStatDTO yearReportStat(List<Integer> deptIds, Integer year) throws BizException;

    /**
     * 统计设备每月数据
     *
     * @param deptIds
     * @param monthBegin
     * @param monthEnd
     * @throws BizException
     */
    void statMachMonthData(List<Integer> deptIds, Date monthBegin, Date monthEnd) throws BizException;

    /**
     * 导出设备日报
     *
     * @param deptId
     * @param date
     * @param deviceType
     * @return
     * @throws BizException
     */
    String dayReportExport(Integer deptId, Date date, Integer deviceType) throws BizException;

    /**
     * 导出设备月报
     *
     * @param deptId
     * @param startDate
     * @param endDate
     * @return
     * @throws BizException
     */
    String monthReportExport(Integer deptId, Date startDate, Date endDate, Integer deviceType) throws BizException;

    /**
     * 导出设备年报
     *
     * @param deptId
     * @param year
     * @return
     * @throws BizException
     */
    String yearReportExport(Integer deptId, Integer year) throws BizException;

    /*********旧报表*********/

    /**
     * 设备日报列表
     *
     * @param deptIds
     * @param startDate
     * @param endDate
     * @param pageNum
     * @param pageSize
     * @return
     * @throws BizException
     */
    @Deprecated
    PageData<AppMachReportDTO> getDayReportDataList(List<Integer> deptIds, Date startDate, Date endDate, Integer pageNum, Integer pageSize) throws BizException;

    /**
     * 设备日报详情
     *
     * @param pageNum
     * @param pageSize
     * @param deptIds
     * @param date
     * @return
     * @throws BizException
     */
    @Deprecated
    PageData<MachDayDataDTO> getDayReportDataDetail(Integer pageNum, Integer pageSize, List<Integer> deptIds, Date date) throws BizException;

    /**
     * 获取设备周报列表
     *
     * @param deptId
     * @param pageNum
     * @param pageSize
     * @param startDate
     * @param endDate
     * @return
     * @throws BizException
     */
    @Deprecated
    PageData<AppMachReportDTO> getWeekReportDataList(Integer deptId, Integer pageNum, Integer pageSize, Date startDate, Date endDate) throws BizException;

    /**
     * 获取设备周报详情
     *
     * @param deptIds
     * @param reportId
     * @param pageNum
     * @param pageSize
     * @return
     * @throws BizException
     */
    @Deprecated
    PageData<AppMachWeekReportDTO> getWeekReportDataDetail(List<Integer> deptIds, Integer reportId, Integer pageNum, Integer pageSize) throws BizException;

    /**
     * 获取设备月报列表
     *
     * @param deptId
     * @param pageNum
     * @param pageSize
     * @param startMonth
     * @param endMonth
     * @return
     * @throws BizException
     */
    @Deprecated
    PageData<AppMachReportDTO> getMonthReportDataList(Integer deptId, Integer pageNum, Integer pageSize, Date startMonth, Date endMonth) throws BizException;

    /**
     * 获取设备月报详情
     *
     * @param deptIds
     * @param reportId
     * @param pageNum
     * @param pageSize
     * @return
     * @throws BizException
     */
    @Deprecated
    PageData<AppMachWeekReportDTO> getMonthReportDataDetail(List<Integer> deptIds, Integer reportId, Integer pageNum, Integer pageSize) throws BizException;

}
